The present invention relates to a variable-length decoding apparatus using relative address.
In a high-definition television (HDTV), a high-definition video tape recorder (HD-VTR), a digital VTR, a digital camcorder, a multimedia system, a video phone or a video conference system, both a video signal and an audio signal are converted into digital signals and the digitally converted signals are transmitted or stored in a recording medium, and then the transmitted or stored signals are decoded and reproduced. Such an encoding and decoding system requires a compression technology for compressing transmission data to maximize a data transmission efficiency. There are a transformation encoding method, a differential pulse code modulation (DPCM) method, a vector quantization method, a variable-length coding method as generally-used methods for encoding video signals. These encoding methods are used to reduce a total amount of data by removing redundancy data included in digital signals.
The variable-length coding method among the above encoding methods includes a run-length coding step and a (modified) Huffman coding step. In the run-length encoding step, the number of continuous zeros is represented as run-lengths to reduce the number of the samples. The run-length being the number of the continuous zeros generated in the run-length coding step and a magnitude or a level of n-zero sample correspond to a single codeword. For example, when certain data is input in sequence of "a, 0, 0, b, 0, 0, 0, 0, c, d, 0, e . . . " where a, b, c, d and e are not equal to zero, the run-length coded data is as follows: "[0, a], [2, b], [4, c], [0, d], [1, e], . . . ". Here, [0, a] represents that there is no zeros before the non-zero first level "a", and [2, b] represents that there are two zeros before the non-zero second level "b". As described above, the shorter-length codeword is assigned to the run-length coded symbol having the higher frequency of occurrence, and the longer-length codeword is assigned the run-length coded symbol having a lower frequency of occurrence, according to the Huffman code table. In case of symbols with extremely low frequency, the Huffman code table is not used. Instead, a fixed-length escape (ESC) code is used for performing a fixed-length coding operation. Then, since it is not proper to lengthen the run-length without limitation, a variable-length coding is performed in units of a certain block. A bitstream of the variable-length-coded data incluctes a code indicative of a start of a certain interval, a code indicative of an end of a certain interval, a code indicative of a video signal, a code indicative of an end-of-block (EOB), a variety of control codes, and a status inclication code.
FIG. 1 shows a conventional variable-length decoder for decoding variable-length-coded data. The FIG. 1 decoder is disclosed in more detail in a paper entitled "An Entropy Coding System For Digital HDTV Applications" (IEEE Transactions On Circuits And Systems For Video Technology, pp. 147-155, vol. 1. No. 1, March 1991, by Shaw-Min Lei and Ming-Ting Sun). Thus, an operation of the FIG. 1 apparatus will be simply described below.
In FIG. 1, the variable-length-coded data is transmitted in the form of a bitstream and is stored in a buffer (not shown) such as a first-in-first-out (FIFO) memory of a receiving end. The buffer outputs N-bit data to a first register 1 whenever a read signal is input thereto from a codeword length accumulator 5. First register 1 latches the N -bit variable-length-coded data output from the buffer whenever the read signal is input thereto from codeword length accumulator 5. A second register 2 latches the N-bit variable-length-coded data output from first register 1. A barrel shifter 3 receives the outputs of first and second registers 1 and 2, and outputs the received signals according to a length of the accumulated codeword output from codeword length accumulator 5. More specifically, barrel shifter 3 outputs the N-bit data stored in a window shifted by the codeword length accumulated in codeword length accumulator 5 to a programmable logic array (PLA) 4. PLA 4 decodes the N-bit variable-length-coded data output from barrel shifter 3, and outputs a codeword length being the number of the bits used for decoding, to codeword length accumulator 5. PLA 4 outputs a symbol for decoding and a codeword length of the symbol. Codeword length accumulator 5 adds the codeword length applied from PLA 4 to the stored accumulated codeword length, and produces a newly accumulated codeword length. Codeword length accumulator 5 generates a read signal if the newly produced accumulated codeword length is not less than N bits, and subtracts the number N of bits from the accumulated codeword length to calculate the accumulated codeword length to be supplied to barrel shifter 3. Codeword length accumulator 5 outputs, however, the accumulated codeword length to barrel shifter 3 if the accumulated codeword length is smaller than the N bits. Barrel shifter 3 outputs the data in a window shifted by the accumulated codeword length supplied from codeword length accumulator 5 among the 2N-bit data supplied from registers 1 and 2, to PLA 4. The detailed descriptions of the FIG. 1 apparatus including the operation of barrel shifter 3 are disclosed in the above Shaw-min Lei and Ming-Ting Sun's reference.
The above conventional variable-length decoding apparatus can decode one code every one clock pulse input. However, it was complicated to design the barrel shifter and the decoding control circuit. It required a large capacity of memory to use a ROM or a programmable logic array (PLA) for storing a variable-length decoding table. To use the barrel shifter, data which is input in the form of a bitstream should be changed in the form of parallel data.